<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>好菜，好下饭-登录</title>
	<link rel="stylesheet" type="text/css"
		href="/FAFCode/OrderManagement/css/reset.css">
		<link rel="stylesheet" type="text/css"
			href="/FAFCode/OrderManagement/css/main.css">
			<link rel="stylesheet" type="text/css"
				href="/FAFCode/OrderManagement/css/mycss.css">
				<script type="text/javascript"
					src="/FAFCode/OrderManagement/common/jquery.js"></script>
</head>
<body>
<script type="text/javascript" src="https://cdn.bootcss.com/canvas-nest.js/1.0.1/canvas-nest.min.js"></script>
	<div class="login_top clearfix">
		<a href="#" class="logo fl"><img class="imgsize"
			src="/FAFCode/OrderManagement/myImage/logo.jpg" width="100"
			height="100"></a>
	</div>

	<div class="login_form_bg">
		<div class="login_form_wrap clearfix">
			<div class="login_banner fl"></div>
			<div class="slogan fl">快马加鞭 · 急速送达</div>
			<div class="login_form fr">
				<div class="login_title clearfix">
					<h1>商家登录</h1>
					<a href="/FAFCode/OrderManagement/StoreRegister.html">立即注册</a>
				</div>
				<div class="form_input">
					<input type="text" name="storeNumber" id="username"
						class="name_input" placeholder="请输入用户名">
						<div class="user_error" id="user_error">输入错误</div> <input
						type="password" name="password" id="password" class="pass_input"
						placeholder="请输入密码">
							<div class="pwd_error" id="pwd_error">输入错误</div>
							<div class="more_input clearfix">
								<input type="checkbox" name=""> <label>记住用户名</label> <a
									href="#">忘记密码</a>
							</div> <input type="button" name="login" value="登录"
							class="input_submit" onclick="login()">
				</div>
			</div>
		</div>
	</div>

	<div class="footer no-mp">
		<div class="foot_link">
			<a href="#">关于我们</a> <span>|</span> <a href="#">联系我们</a> <span>|</span>
			<a href="#">招聘人才</a> <span>|</span> <a href="#">友情链接</a>
		</div>
		<p>Code-PigBang 2020 南昌航空大学20-713</p>
		<p>电话：123654789 京ICP备996996700700号</p>
	</div>
	<script>
		function login() {
			var storeNumber = document.getElementById("username").value;
			var password = document.getElementById("password").value;
			$
					.ajax({
						type : 'POST',
						url : "/FAFCode/StoreLogin",
						data : {
							"storeNumber" : storeNumber,
							"password" : password,
							"BusinessCenter" : 1
						},
						dataType : 'text',
						success : function(data) {
							if (data == "1") {
								window.location.href = '/FAFCode/OrderManagement/ViewOrders.jsp';
							} else if (data == "-1") {
								document.getElementById('user_error').style.display = "block";
								alert('用户名错误!');
							} else {
								document.getElementById('pwd_error').style.display = "block";
								alert('密码错误!');
							}
						}
					})
		}
	</script>
</body>
</html>